<template>
	<view>
		<!--图文课程试看部分-->
		<view class="try-content" v-if="data.type=='image_text' && data.purchase == 0">
			<rich-text :nodes="util.formatRichText(data.try_image_text)"></rich-text>
		</view>
		
		<!--图文课程完整部分-->
		<view class="all-content" v-if="data.type=='image_text' && (data.purchase == 1 || data.can_be_used_card!=undefined && data.can_be_used_card.member_card_info.discount == 0)">
			<rich-text selectable="true" :nodes="util.formatRichText(data.image_text)"></rich-text>
		</view>
	</view>
</template>

<script>
	import muu from '../../static/js/time.js'
	
	export default {
		name: 'ImageText',
		props: {
			data: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {
				
			}
		},
		created() {
			this.startTime()
		},
		destroyed() {
			muu.stopTimeSend()
		},
		methods: {
			
			startTime(){
				if(this.data.purchase == 1 || this.data.can_be_used_card!=undefined && this.data.can_be_used_card.member_card_info.discount == 0){
					muu.startTimeSend('Knowledge',this.data.id)
				}
			}
		}
	}
</script>

<style>

</style>
